from time import sleep

from selenium import  webdriver
from setting import Client,Server


def get_driver(type=1):
    """

    :param type: type!=0 代表运行前台， type=0代表运行后台
    :return:
    """
    driver = webdriver.Chrome()
    if type:
        driver.get(Client.client_url)
    else:
        driver.get(Server.server_url)
        sleep(4)
    driver.maximize_window()
    return driver